package com.Test;


import com.meth.method;
import java.util.Scanner;

public class mTest {


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String  CardId=null;
        int Password;

        //账户校验
        while(true){
            System.out.print("账户校验,输入卡号");
            CardId= sc.nextLine();
            System.out.print("输入密码");
            Password = sc.nextInt();
            //消耗换行符
            sc.nextLine();
            if (method.check_Login(CardId,Password)){
                break;
            }
            System.out.println("卡号或者密码有无请重新输入");

        }

        //校验成功后,进入操作系统
        boolean CONTROL = true;
        while (CONTROL) {
            int k;
            System.out.println("请输入对应数字进行操作\n" +
                    "####################\n" +
                    "1.查询余额\n" +
                    "2.ATM取款\n" +
                    "3.ATM存款\n" +
                    "4.修改密码\n" +
                    "5.退出\n" +
                    "####################\n");

            k = sc.nextInt();
            switch (k) {
                case 1:
                    method.query_Money(CardId);
                    break;
                case 2:
                    method.withdraw_Money(CardId);
                    break;
                case 3:
                    method.deposit_Money(CardId);
                    break;
                case 4:
                     method.change_Password(CardId);
                    break;
                case 5:
                    System.out.println("再见");
                    CONTROL = false;
                    break;
                default:
                    System.out.println("选择错误,请搓重新选择");

            }
        }
    }
}
